<?php
$dsn="mysql:host=localhost;dbname=exam";
$db=new PDO($dsn,'root','');
//UTF8编码
$db->query('set names utf8');
//select 查表
$result=$db->query('select * from exam0');
$result->setFetchMode(PDO::FETCH_ASSOC);
$insert=$db->prepare ("update exam0 set time='1', place='1', teacher='1' where course='PHP' AND class='1班'");
$insert->execute();
?>